<?php
/* @var $this DefaultController */
$this->breadcrumbs += array(
    'Каталог'=>'/katalog'
);

$this->setPageTitle("Каталог - " . $model->title . " в Светлогорске");

if ($model) {
    $this->breadcrumbs += Category::model()->buildParentsArray($model);
    $this->breadcrumbs[]=$model->title;
    $this->setPageTitle($model->title . " купить в Светлогорске");
    $this->filter = '

    <div class="form_block">
        <div class="tx">
            Брэнд:
        </div>
        <div>
'. CHtml::DropDownList('brand', isset($brand) ? $brand : null,  $brandDropDownList, array('class'=>'form-control input-sm pricename', 'submit'=>'/Category/default/list/'.$model->id, 'params'=>array('id'=>$model->id)))
        .'
        </div>
    </div>

    <div class="form_block">
        <div class="tx">
            Цена от:            
            </div>
            <div> '. CHtml::textField('priceFrom', isset($priceFrom) && $priceFrom>0 ? $priceFrom : '', array('size'=>5, 'class'=>'form-control input-sm pricename', 'submit'=>'/Category/default/list/'.$model->id, 'params'=>array('id'=>$model->id))) .'

            </div>
            </div>
            <div class="form_block">
            <div class="tx">до: </div><div> '. CHtml::textField('priceTo', isset($priceTo) && $priceTo>0 ? $priceTo : '', array('size'=>5, 'class'=>'form-control input-sm pricename', 'submit'=>'/Category/default/list/'.$model->id, 'params'=>array('id'=>$model->id))) .'
        </div>
    </div>
    <div class="form_block">
        <div class="tx">
            Товаров на странице:
            </div>
            <div>
            '. CHtml::DropDownList('prodPerPage', isset($prodPerPage) ? $prodPerPage : null,  array('5'=>' 5', '10'=>' 10', '20'=>' 20', '50'=>' 50'), array('class'=>'form-control input-sm pricename', 'submit'=>'/Category/default/list/'.$model->id, 'params'=>array('id'=>$model->id)))
        .'
        </div>
    </div>
';
}

?>

    <div class="bb-page-header">
        <h1><?php echo $this->getPageTitle(); ?> </h1>
    </div>

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'category-form',
    'action'=>'/Order/default/createOrder',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'enableAjaxValidation'=>true,
    'errorMessageCssClass'=>'alert alert-danger',
    'htmlOptions'=>array('enctype'=>'multipart/form-data')
)); ?>


<?php if ($subTree): ?>
    <?php echo $subTree; ?>
<?php elseif($message): ?>
    <?php echo $message; ?>
<?php else: ?>

<?php if ($list->getData()):?>


    <?php $products = $list->getData(); ?>
<table class='table product-item'>
        <?php foreach ($products as $product): ?>

            <?php $this->widget('productWidget', array(
                'product'=>$product
            )); ?>
            <?php endforeach; ?>
    </table>
    <div class="clearfix"></div>

        <div style="text-align: center;">
            <?php $this->widget('CLinkPager', array(
                'pages' => $list->getPagination(),
                'htmlOptions' => array('class'=>'pagination input-sm'),
                'selectedPageCssClass' => 'active',
                'header' => '',
                'nextPageLabel' => 'След.',
                'lastPageLabel' => '&raquo;',
                'firstPageLabel' => '&laquo;',
                'prevPageLabel' => 'Пред.'
            ))?>
        </div>

<?php else: ?>
    По Вашему запросу ничего не найдено.
<?php endif;?>
<?php endif;?>
<?php $this->endWidget(); ?>
